package com.fyy.minio.sdxt;

import okhttp3.*;

import java.io.IOException;

public class queryAlarmPicApiTest {

    public final static String PICURL = "http://123.13.218.244:86/ftp_admin/20221012/1002000100000000000000000033100/20221012100112_001.jpg";
    public final static String URI = "http://124.133.246.142:20013/picAnalyseRetNotify";

    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient().newBuilder().build();
        MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
        StringBuilder s = new StringBuilder();
        s.append("meid=86296804289799600");
        s.append("&");
        s.append("picname=123456789.jpg");
        s.append("&");
        s.append("applicationip=123456789.jpg");
        s.append("&");
        s.append("applicationport=123456789.jpg");
        RequestBody body = RequestBody.create(mediaType,s.toString());
        Request request = new Request.Builder()
                .url(URI)
                .method("POST",body)
                .addHeader("Content-Type","application/x-www-form-urlencoded")
                .build();
        Response response = client.newCall(request).execute();
        System.out.println("请求结果：" + response.code());
        if(response.isSuccessful()){
            String result = response.body().string();
            System.out.println(result);
        }
    }

}
